#pragma once

#include "Staple.h"
#include "Drink.h"

class PackageFactory
{
public:
	virtual ~PackageFactory() {};
	virtual Drink* CreateDrink() = 0;
	virtual Staple* CreaetStaple() = 0;
protected:
	PackageFactory() {}
private:
};

class SteakPackageFactory : public PackageFactory
{
public:
	static SteakPackageFactory* Instance() { if (!_instance) _instance = new SteakPackageFactory; return _instance; }
	~SteakPackageFactory() {};
	Drink* CreateDrink() { return new Wine; }
	Staple* CreaetStaple() { return new Steak; }
protected:
	SteakPackageFactory() {}
private:
	static SteakPackageFactory* _instance;
};

class PorkPackageFactory : public PackageFactory
{
public:
	static PorkPackageFactory* Instance() { if (!_instance) _instance = new PorkPackageFactory; return _instance; }
	~PorkPackageFactory() {}
	Drink* CreateDrink() { return new Brandy; }
	Staple* CreaetStaple() { return new Pork; }
protected:
	PorkPackageFactory() {}
private:
	static PorkPackageFactory* _instance;
};

SteakPackageFactory* SteakPackageFactory::_instance = nullptr;
PorkPackageFactory* PorkPackageFactory::_instance = nullptr;
